package com.juhuixing.common.enums;

public enum YesNoEnum {

    YES("1", "正常"),
    NO("0", "禁用");

    String code;
    String desc;

    public static YesNoEnum getIsEnableEnum(String code) {
        for (YesNoEnum bean : values()) {
            if (bean.getCode().equals(code)) {
                return bean;
            }
        }
        return null;
    }

    public static String getDesc(String code) {
        for (YesNoEnum bean : values()) {
            if (bean.getCode().equals(code)) {
                return bean.getDesc();
            }
        }
        return null;
    }


    YesNoEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

}
